import React from 'react'
import {HashRouter,Route,Switch} from 'react-router-dom'
import App from './App'
import Login from './pages/login'
import Admin from './admin'

import Home from './pages/home'
import Buttons from './pages/ui/buttons'
import Modals from './pages/ui/modals'
import Loadings from './pages/ui/loadings'
import Notice from './pages/ui/notice'
import Messages from './pages/ui/messages'
import Gallery from './pages/ui/gallery'
import Tabs from './pages/ui/tabs'
import Carousel from './pages/ui/carousel'

// 表单
import FormLogin from './pages/form/login'
import FormRegister from './pages/form/register'

// 表格
import BasicTable from './pages/table/basicTable'
import HightTable from './pages/table/hightTable'

import City from './pages/city'

/**
 * Admin:父级路由
 */
export default class Irouter extends React.Component {

  render(){
    return (
      <HashRouter>
        <App>
          <Switch>
            <Route path='/login' component={Login}/>
            <Route path='/' render={() =>
              <Admin>
                <Switch>
                  <Route path='/home' component={Home} />
                  <Route path="/ui/buttons" component={Buttons} />
                  <Route path="/ui/modals" component={Modals} />
                  <Route path="/ui/loadings" component={Loadings} />
                  <Route path="/ui/notification" component={Notice} />
                  <Route path="/ui/messages" component={Messages} />
                  <Route path="/ui/tabs" component={Tabs} />
                  <Route path="/ui/gallery" component={Gallery} />
                  <Route path="/ui/carousel" component={Carousel} />

                  <Route path="/form/login" component={FormLogin} />
                  <Route path="/form/reg" component={FormRegister} />
                  
                  <Route path="/table/basic" component={BasicTable} />
                  <Route path="/table/hight" component={HightTable} />
                  <Route path="/city" component={City} />
                  
                </Switch>
              </Admin>
            }/>
          </Switch>
          
        </App>
      </HashRouter>
    )
  }
}